Skip to content

Pick a saved signature or initials directly on PDF fields and printed lines - #44

Open
mberman84 wants to merge 15 commits into
mainfrom
codex/multiple-signatures
Open

mberman84 wants to merge 15 commits into
mainfrom
codex/multiple-signatures

Conversation

@mberman84

@mberman84 mberman84 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Saving initials used to replace your full signature. Even with both marks saved, signing two fields meant going back through the placement dialog for each one.

Change

Click an empty PDF signature field to see your saved marks beside it. Each choice shows its name and handwritten image. Choosing one signs that field immediately. With no saved marks, clicking a field opens capture with that field already selected.

Folio remembers multiple named signatures on this device, carries forward the existing saved signature, and lets you forget each one separately in Settings.

Folio also makes printed lines labeled Signature or Initials clickable when their labels are selectable text. It uses nearby drawn rules or underscores and can offer clear signing space next to a standalone label. Choosing a saved mark places it on that line. Other possible signing areas still offer Review.

Issue or approval

Requested by the repository maintainer in the Folio workspace.

How I checked it

The production build and TypeScript check passed. The off-screen Windows smoke suite passed. Six consecutive runs of the signing workflow also passed, including rapid placement, keyboard zoom, undo and redo. The regression clicks the PDF coordinates of a rotated, zoomed form, chooses a full signature and initials for separate fields, exercises undo and keyboard selection, and verifies both stamp centers in the exported PDF. It also covers first-time capture, existing saved signatures, and switching from editing to signing. The printed-line regression clicks a transformed drawn rule and underscores by PDF coordinates, checks undo and redo, signs a standalone label, and verifies both exported stamp positions on a page with a native widget.

Windows, macOS, and Linux CI passed

Printed lines before

Two printed lines and the previous Review signature button

Printed lines after

Saved full name and initials beside the printed signature line

Before — choosing a saved mark required opening Review.

The same two-field form in the previous desktop workflow

After — both saved marks appear beside the field you clicked.

The on-page picker beside the signature field with full signature and initials

Saved signatures in Settings

One remembered signature in the previous settings

Full signature and initials listed separately in Settings

Implemented with GPT-6 in Codex Desktop.

Copy link
Copy Markdown
Collaborator Author

P2 — Distinguish signatures with the same name before one-click signing. Save two different signature images under the same name, then open a PDF with one empty signature field. The picker shows identical labels, and Sign field applies the selected image without a preview. Please show which image will be applied or disambiguate the entries, including signatures already saved with duplicate names. All three platform CI jobs passed at 1a2886f. Picker · CI

@mberman84 mberman84 changed the title Save and choose from multiple handwritten signatures Pick a saved signature or initials directly on a PDF field Nov 3, 2026
@mberman84 mberman84 changed the title Pick a saved signature or initials directly on a PDF field Pick a saved signature or initials directly on PDF fields and printed lines Nov 3, 2026

apexEvan commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Related regression from using the current release: the text fallback can propose a position inside ordinary contract prose, for example “except by a writing signed by both parties,” because it contains “signed by.” I saw this PR already addresses printed signing lines, so I am sharing the regression here instead of opening a competing detection PR.

A narrow candidate fix and synthetic regression restrict the existing text fallback to standalone signing captions while preserving native PDF signature fields. It deliberately does not try to solve printed “By:” lines or broader layout analysis. The synthetic PDF includes misleading prose plus a valid witness-signature caption; the regression fails on the original code and passes with the candidate fix. The integrated macOS production build and full off-screen smoke suite pass.

This conservative fallback may fit into your detector work; happy for it to be adapted or superseded. No private document or actual signature is included.

Copy link
Copy Markdown
Collaborator Author

Please address two signing cases before merging:

  1. On a page with one signature field, the bottom Sign field shortcut lists saved marks by name alone. Two different images can already have the same name. Please show the actual signature images before the user commits, as the on-page picker does, or remove the bottom shortcut and keep the on-page picker. Please check this with two existing marks that share a name.
  2. Please restrict the printed-text fallback to standalone signing captions. Add a regression with ordinary contract text containing “signed by both parties” and a genuine “Witness signature” caption on the same page. Only the caption should produce a suggestion. Please preserve native PDF signature fields and detection of labeled printed lines.

Please rebase onto the latest main, resolve the conflicts, and rerun CI on Windows, macOS, and Linux.

claude and others added 2 commits November 7, 2026 12:49
Settings is now split into sections, so the saved signatures list moves
under Storage and the smoke tests open that section before forgetting a
mark. Signing uses markDirty() so a save that finishes while a signature
is being placed no longer clears the unsaved state.

Co-Authored-By: Claude Code <[email protected]>
Claude-Session: https://claude.ai/code/session_01GrVC9YYp69WZsZiwADn8CQ
…y standalone captions

The shortcut for a page with one signature field listed saved marks by name,
and two marks can share a name. It now shows each mark's image and signs in
one click.

Printed text is offered as a place to sign only when the text run is nothing
but a signing caption. A sentence such as "a writing signed by both parties"
is no longer suggested. The anchored caption match follows apexEvan's
codex/signature-captions.

The smoke test covers two marks with the same name, and a page with contract
prose next to a "Witness signature" rule.

Co-authored-by: apexEvan <[email protected]>
Co-Authored-By: Claude Code <[email protected]>
Claude-Session: https://claude.ai/code/session_01GrVC9YYp69WZsZiwADn8CQ

Copy link
Copy Markdown
Collaborator Author

Both blockers are fixed in 6385d29, with main merged in.

  1. The Sign field shortcut now shows each saved mark as its image and signs in one click. The smoke test covers two marks that share a name.
  2. Printed text is suggested only when the text run is a signing caption on its own. A page with "writing signed by both parties" and a ruled "Witness signature" now offers only the caption. The smoke test fails without the fix. The anchored match follows codex/signature-captions from @apexEvan.

One trade-off: a single text run that holds several captions, such as "Signature: ____ Date: ____", is no longer suggested unless it has a matching rule. Native signature fields and labeled printed lines work as before.

Checked on Linux: npx tsc --noEmit, npm run build, npm run smoke. CI is running on Windows, macOS, and Linux.


Generated by Claude Code

After the sample is reopened, its saved highlights and drawings are read a
moment after the document opens. The test saved a copy as soon as the first
text appeared, so on a slow runner the copy could have no marks at all and
the highlight count check failed. Wait until the first page has all six of
its marks back before saving.

Co-Authored-By: Claude Code <[email protected]>
Claude-Session: https://claude.ai/code/session_01GrVC9YYp69WZsZiwADn8CQ

Copy link
Copy Markdown
Collaborator Author

CI is green on Windows, macOS, and Linux at cf5d70f.

The first run failed on Linux in an existing highlight test, not in the signature changes. The smoke test saved a copy right after reopening the sample, before its saved highlights and drawings had loaded, so the copy had none. cf5d70f makes the test wait for the first page to have its marks back. The same race is in the test on main.


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants